<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<script type="text/javascript">
$(function(){
   
   $("#memberRegister").submit(function(){
      var name=$(" :input[name=memberName]");
      var email=$(" :input[name=memberEmail]");
      var tel=$(" :input[name=memberTel]");
      
      var phoneNumberRegex = /^[0-9]{3}-[0-9]{3,4}-[0-9]{4}$/;
 	 if(!phoneNumberRegex.test($(":input[name=memberTel]").val())) {
 		 alert("전화번호 형식에 맞게 입력하세요!");
 		 return false;
 	}
 	 
      if(name.val()==""){
         alert("이름을 입력해주세요!");
         name.focus();
         return false;
      }
      if(email.val()==""){
          alert("email을 입력해주세요!");
          email.focus();
          return false;
       }
 
      if(tel.val()==""){
         alert("연란처를 입력해주세요!");
         tel.focus();
         return false;
      }
    
   });
});
</script>
 <center>
 <form method="post"  id="memberRegister" action="${initParam.root }member/findMyId.do">
<h3><font color="skyblue"><b>비밀번호 찾기</b></font></h3>
<table>
<tr>
<td><b>이름</b></td><td><input type="text" name="memberName"></td>
</tr>
<tr>
<td><b>E-mail</b></td><td><input type="email" name="memberEmail"></td>
</tr>
<tr>
<td><b>연락처</b></td><td><input type="text" name="memberTel"></td>
</tr>
<tr>
<td colspan="4"><font size="2">※'-'을 넣어주세요. 예시)010-1111-2222</font></td>
</tr>

<tr>
<td colspan="4" align="center"><input type="submit" value="Id찾기"></td>
</tr>
</table>
</form>
</center>